﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;

namespace 控制台应用
{
    public class MD5Encryption
    {
        #region MD5加密
        public static string encodePwd(string strPwd)
        {
            if (strPwd == null || strPwd.Trim() == "")
                return "";
            byte[] result = Encoding.Default.GetBytes(strPwd);
            MD5 md5 = new MD5CryptoServiceProvider();
            byte[] output = md5.ComputeHash(result);
            return BitConverter.ToString(output).Replace("-", "");
        }
        #endregion


    }
}
